# auto generated file

# detect target platform
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
	set( TARGET_PLATFORM "PLATFORM_LINUX" CACHE INTERNAL "" FORCE )

elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
	set( TARGET_PLATFORM "PLATFORM_ANDROID" CACHE INTERNAL "" FORCE )

elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
	set( TARGET_PLATFORM "PLATFORM_MACOS" CACHE INTERNAL "" FORCE )

elseif (${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
	set( TARGET_PLATFORM "PLATFORM_IPHONE" CACHE INTERNAL "" FORCE )

elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
	set( TARGET_PLATFORM "PLATFORM_WINDOWS" CACHE INTERNAL "" FORCE )

elseif (${CMAKE_SYSTEM_NAME} STREQUAL "WindowsCE")
	set( TARGET_PLATFORM "PLATFORM_WINDOWSCE" CACHE INTERNAL "" FORCE )

elseif (${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
	set( TARGET_PLATFORM "PLATFORM_WINDOWS_UWP" CACHE INTERNAL "" FORCE )

elseif (${CMAKE_SYSTEM_NAME} STREQUAL "WindowsPhone")
	set( TARGET_PLATFORM "PLATFORM_WINDOWS_PHONE" CACHE INTERNAL "" FORCE )

elseif (${CMAKE_SYSTEM_NAME} STREQUAL "QNX")
	set( TARGET_PLATFORM "PLATFORM_QNX" CACHE INTERNAL "" FORCE )
else ()
	message( FATAL_ERROR "unsupported platform ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}" )
endif ()
message( STATUS "TARGET_PLATFORM: ${TARGET_PLATFORM}" )

# detect target platform bits
if (${CMAKE_SIZEOF_VOID_P} EQUAL 8)
	set( PLATFORM_BITS 64 CACHE INTERNAL "" FORCE )
elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
	set( PLATFORM_BITS 32 CACHE INTERNAL "" FORCE )
else ()
	message( FATAL_ERROR "unsupported platform bits!" )
endif ()

if ( WIN32 )
	set( CMAKE_SYSTEM_VERSION "8.1" CACHE INTERNAL "" FORCE )
endif()
#==================================================================================================
# Visual Studio Compilation settings
#==================================================================================================
set( COMPILER_MSVC OFF )
string( FIND "${CMAKE_CXX_COMPILER_ID}" "MSVC" outPos )
if ( (outPos GREATER -1) )
	set( COMPILER_MSVC ON )
endif()
if ( COMPILER_MSVC )
	set( DETECTED_COMPILER "COMPILER_MSVC" )
	set( CURRENT_C_FLAGS ${CMAKE_C_FLAGS} )
	set( CURRENT_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
	set( CURRENT_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} )
	set( CURRENT_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS} )
	set( CURRENT_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} )
	string( REPLACE "/EHa" " " CURRENT_CXX_FLAGS "${CURRENT_CXX_FLAGS}" )
	string( REPLACE "/EHsc" " " CURRENT_CXX_FLAGS "${CURRENT_CXX_FLAGS}" )
	string( REPLACE "/EHs" " " CURRENT_CXX_FLAGS "${CURRENT_CXX_FLAGS}" )
	string( REPLACE "//EHs-c-" " " CURRENT_CXX_FLAGS "${CURRENT_CXX_FLAGS}" )
	#--------------------------------------------
	
	set( CONFIGURATION_DEPENDENT_PATH ON CACHE INTERNAL "" FORCE )
				
	string( FIND "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}" "." outLength )
	if ( (outLength GREATER -1) )
		string( SUBSTRING "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}" 0 ${outLength} WINDOWS_TARGET_VERSION )
	endif() 
	#--------------------------------------------
	message( STATUS "CMAKE_C_FLAGS: ${CURRENT_C_FLAGS}" )
	message( STATUS "CMAKE_CXX_FLAGS: ${CURRENT_CXX_FLAGS}" )
	message( STATUS "CMAKE_EXE_LINKER_FLAGS: ${CURRENT_EXE_LINKER_FLAGS}" )
	message( STATUS "CMAKE_STATIC_LINKER_FLAGS: ${CURRENT_STATIC_LINKER_FLAGS}" )
	message( STATUS "CMAKE_SHARED_LINKER_FLAGS: ${CURRENT_SHARED_LINKER_FLAGS}" )
	set( CMAKE_CONFIGURATION_TYPES Release Profile Debug )
	set( CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Configurations" FORCE )
	
	# Release
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>: > )
	set( CMAKE_C_FLAGS_RELEASE "${CURRENT_C_FLAGS} /D_NDEBUG /DNDEBUG  /MD /Ox /MP " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_RELEASE "${CURRENT_CXX_FLAGS} /D_NDEBUG /DNDEBUG /D_HAS_EXCEPTIONS=0  /MD /Ox /MP " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CURRENT_EXE_LINKER_FLAGS} /LTCG /RELEASE " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CURRENT_STATIC_LINKER_FLAGS} /LTCG /RELEASE " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CURRENT_SHARED_LINKER_FLAGS} /LTCG /RELEASE " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_RELEASE  /std:c++latest /MP /Gm- /Zc:inline /Gy- /fp:strict /fp:except- /DCOMPILER_MSVC "/D${TARGET_PLATFORM}" "/DWINDOWS_TARGET_VERSION=${WINDOWS_TARGET_VERSION}" "/DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "/DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "/DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_RELEASE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_RELEASE " /OPT:REF /OPT:ICF /INCREMENTAL:NO /LTCG /RELEASE /DYNAMICBASE" CACHE INTERNAL "" FORCE )
	# Profile
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Profile>: > )
	set( CMAKE_C_FLAGS_PROFILE "${CURRENT_C_FLAGS} /D_NDEBUG /DNDEBUG  /MD /Od /MP " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_PROFILE "${CURRENT_CXX_FLAGS} /D_NDEBUG /DNDEBUG  /MD /Od /Zi /MP " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_PROFILE "${CURRENT_EXE_LINKER_FLAGS} /DEBUG /PROFILE " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CURRENT_STATIC_LINKER_FLAGS} /DEBUG /PROFILE " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CURRENT_SHARED_LINKER_FLAGS} /DEBUG /PROFILE " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_PROFILE  /std:c++latest /MP /Gm- /Zc:inline /Gy- /fp:strict /fp:except- /DCOMPILER_MSVC "/D${TARGET_PLATFORM}" "/DWINDOWS_TARGET_VERSION=${WINDOWS_TARGET_VERSION}" "/DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "/DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "/DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_PROFILE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_PROFILE " /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUG /PROFILE" CACHE INTERNAL "" FORCE )
	# Debug
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>: > )
	set( CMAKE_C_FLAGS_DEBUG "${CURRENT_C_FLAGS} /D_DEBUG /D_ITERATOR_DEBUG_LEVEL=1 /MDd /Od /MP " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_DEBUG "${CURRENT_CXX_FLAGS} /D_DEBUG /D_ITERATOR_DEBUG_LEVEL=1 /MDd /Od /Zi /MP " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_DEBUG "${CURRENT_EXE_LINKER_FLAGS} /DEBUG:FULL " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CURRENT_STATIC_LINKER_FLAGS} /DEBUG:FULL " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CURRENT_SHARED_LINKER_FLAGS} /DEBUG:FULL " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_DEBUG  /std:c++latest /MP /Gm- /Zc:inline /Gy- /fp:strict /fp:except- /DCOMPILER_MSVC "/D${TARGET_PLATFORM}" "/DWINDOWS_TARGET_VERSION=${WINDOWS_TARGET_VERSION}" "/DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "/DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "/DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_DEBUG  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_DEBUG " /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUG:FULL" CACHE INTERNAL "" FORCE )
	set( CMAKE_BUILD_TYPE "Debug")
endif()


#==================================================================================================
# GCC Compilation settings
#==================================================================================================
set( COMPILER_GCC OFF )
string( FIND "${CMAKE_CXX_COMPILER_ID}" "GNU" outPos )
if ( (outPos GREATER -1) )
	set( COMPILER_GCC ON )
endif()
if ( COMPILER_GCC )
	set( DETECTED_COMPILER "COMPILER_GCC" )
	#--------------------------------------------
	set( CONFIGURATION_DEPENDENT_PATH OFF CACHE INTERNAL "" FORCE )
	#--------------------------------------------
	message( STATUS "CMAKE_C_FLAGS: ${CURRENT_C_FLAGS}" )
	message( STATUS "CMAKE_CXX_FLAGS: ${CURRENT_CXX_FLAGS}" )
	message( STATUS "CMAKE_EXE_LINKER_FLAGS: ${CURRENT_EXE_LINKER_FLAGS}" )
	message( STATUS "CMAKE_STATIC_LINKER_FLAGS: ${CURRENT_STATIC_LINKER_FLAGS}" )
	message( STATUS "CMAKE_SHARED_LINKER_FLAGS: ${CURRENT_SHARED_LINKER_FLAGS}" )
	set( CMAKE_CONFIGURATION_TYPES Release Profile Debug )
	set( CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Configurations" FORCE )
	
	# Release
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>: > )
	set( CMAKE_C_FLAGS_RELEASE "${CURRENT_C_FLAGS} -D_NDEBUG -DNDEBUG  -O3 -finline-functions " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_RELEASE "${CURRENT_CXX_FLAGS} -D_NDEBUG -DNDEBUG  -O3 -finline-functions " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_RELEASE  -DCOMPILER_GCC "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_RELEASE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_RELEASE " -static-libgcc -static-libstdc++" CACHE INTERNAL "" FORCE )
	# Profile
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Profile>: > )
	set( CMAKE_C_FLAGS_PROFILE "${CURRENT_C_FLAGS} -D_NDEBUG -DNDEBUG  -O2 " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_PROFILE "${CURRENT_CXX_FLAGS} -D_NDEBUG -DNDEBUG  -O2 " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_PROFILE "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_PROFILE  -DCOMPILER_GCC "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_PROFILE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_PROFILE " -static-libgcc -static-libstdc++" CACHE INTERNAL "" FORCE )
	# Debug
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>: > )
	set( CMAKE_C_FLAGS_DEBUG "${CURRENT_C_FLAGS} -D_DEBUG -Og " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_DEBUG "${CURRENT_CXX_FLAGS} -D_DEBUG -Og " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_DEBUG "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_DEBUG  -DCOMPILER_GCC "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_DEBUG  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_DEBUG " -static-libgcc -static-libstdc++" CACHE INTERNAL "" FORCE )
	set( CMAKE_BUILD_TYPE "Debug")
endif()


#==================================================================================================
# Clang Compilation settings
#==================================================================================================
set( COMPILER_CLANG OFF )
string( FIND "${CMAKE_CXX_COMPILER_ID}" "Clang" outPos )
if ( (outPos GREATER -1) AND (WIN32 OR UNIX) )
	set( COMPILER_CLANG ON )
endif()
if ( COMPILER_CLANG )
	set( DETECTED_COMPILER "COMPILER_CLANG" )
	#--------------------------------------------
	set( CONFIGURATION_DEPENDENT_PATH OFF CACHE INTERNAL "" FORCE )
	#--------------------------------------------
	message( STATUS "CMAKE_C_FLAGS: ${CURRENT_C_FLAGS}" )
	message( STATUS "CMAKE_CXX_FLAGS: ${CURRENT_CXX_FLAGS}" )
	message( STATUS "CMAKE_EXE_LINKER_FLAGS: ${CURRENT_EXE_LINKER_FLAGS}" )
	message( STATUS "CMAKE_STATIC_LINKER_FLAGS: ${CURRENT_STATIC_LINKER_FLAGS}" )
	message( STATUS "CMAKE_SHARED_LINKER_FLAGS: ${CURRENT_SHARED_LINKER_FLAGS}" )
	set( CMAKE_CONFIGURATION_TYPES Release Profile Debug )
	set( CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Configurations" FORCE )
	
	# Release
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>: > )
	set( CMAKE_C_FLAGS_RELEASE "${CURRENT_C_FLAGS} -D_NDEBUG -DNDEBUG  -O3 " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_RELEASE "${CURRENT_CXX_FLAGS} -D_NDEBUG -DNDEBUG  -O3 " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_RELEASE  -DCOMPILER_CLANG "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_RELEASE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_RELEASE "" CACHE INTERNAL "" FORCE )
	# Profile
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Profile>: > )
	set( CMAKE_C_FLAGS_PROFILE "${CURRENT_C_FLAGS} -D_NDEBUG -DNDEBUG  -O2 " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_PROFILE "${CURRENT_CXX_FLAGS} -D_NDEBUG -DNDEBUG  -O2 " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_PROFILE "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_PROFILE  -DCOMPILER_CLANG "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_PROFILE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_PROFILE "" CACHE INTERNAL "" FORCE )
	# Debug
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>: > )
	set( CMAKE_C_FLAGS_DEBUG "${CURRENT_C_FLAGS} -D_DEBUG -Og " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_DEBUG "${CURRENT_CXX_FLAGS} -D_DEBUG -Og " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_DEBUG "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_DEBUG  -DCOMPILER_CLANG "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_DEBUG  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "" FORCE )
	set( CMAKE_BUILD_TYPE "Debug")
endif()


#==================================================================================================
# Clang Compilation settings
#==================================================================================================
set( COMPILER_CLANG_APPLE OFF )
string( FIND "${CMAKE_CXX_COMPILER_ID}" "Clang" outPos )
if ( (outPos GREATER -1) AND (APPLE) )
	set( COMPILER_CLANG_APPLE ON )
endif()
if ( COMPILER_CLANG_APPLE )
	set( DETECTED_COMPILER "COMPILER_CLANG_APPLE" )
	#--------------------------------------------
	set( CONFIGURATION_DEPENDENT_PATH ON CACHE INTERNAL "" FORCE )
	#--------------------------------------------
	message( STATUS "CMAKE_C_FLAGS: ${CURRENT_C_FLAGS}" )
	message( STATUS "CMAKE_CXX_FLAGS: ${CURRENT_CXX_FLAGS}" )
	message( STATUS "CMAKE_EXE_LINKER_FLAGS: ${CURRENT_EXE_LINKER_FLAGS}" )
	message( STATUS "CMAKE_STATIC_LINKER_FLAGS: ${CURRENT_STATIC_LINKER_FLAGS}" )
	message( STATUS "CMAKE_SHARED_LINKER_FLAGS: ${CURRENT_SHARED_LINKER_FLAGS}" )
	set( CMAKE_CONFIGURATION_TYPES Release Profile Debug )
	set( CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Configurations" FORCE )
	
	# Release
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>: > )
	set( CMAKE_C_FLAGS_RELEASE "${CURRENT_C_FLAGS} -D_NDEBUG -DNDEBUG  -O3 -finline-functions " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_RELEASE "${CURRENT_CXX_FLAGS} -D_NDEBUG -DNDEBUG  -O3 -finline-functions " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_RELEASE  -DCOMPILER_CLANG "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_RELEASE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_RELEASE "" CACHE INTERNAL "" FORCE )
	# Profile
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Profile>: > )
	set( CMAKE_C_FLAGS_PROFILE "${CURRENT_C_FLAGS} -D_NDEBUG -DNDEBUG  -O2 " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_PROFILE "${CURRENT_CXX_FLAGS} -D_NDEBUG -DNDEBUG  -O2 " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_PROFILE "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_PROFILE  -DCOMPILER_CLANG "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_PROFILE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_PROFILE "" CACHE INTERNAL "" FORCE )
	# Debug
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>: > )
	set( CMAKE_C_FLAGS_DEBUG "${CURRENT_C_FLAGS} -D_DEBUG -Og " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_DEBUG "${CURRENT_CXX_FLAGS} -D_DEBUG -Og " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_DEBUG "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_DEBUG  -DCOMPILER_CLANG "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_DEBUG  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "" FORCE )
	set( CMAKE_BUILD_TYPE "Debug")
endif()


#==================================================================================================
# Clang Compilation settings
#==================================================================================================
set( COMPILER_CLANG_ANDROID OFF )
string( FIND "${CMAKE_CXX_COMPILER_ID}" "Clang" outPos )
if ( (outPos GREATER -1) AND (DEFINED ANDROID) )
	set( COMPILER_CLANG_ANDROID ON )
endif()
if ( COMPILER_CLANG_ANDROID )
	set( DETECTED_COMPILER "COMPILER_CLANG_ANDROID" )
	#--------------------------------------------
	set( CONFIGURATION_DEPENDENT_PATH OFF CACHE INTERNAL "" FORCE )
	#--------------------------------------------
	message( STATUS "CMAKE_C_FLAGS: ${CURRENT_C_FLAGS}" )
	message( STATUS "CMAKE_CXX_FLAGS: ${CURRENT_CXX_FLAGS}" )
	message( STATUS "CMAKE_EXE_LINKER_FLAGS: ${CURRENT_EXE_LINKER_FLAGS}" )
	message( STATUS "CMAKE_STATIC_LINKER_FLAGS: ${CURRENT_STATIC_LINKER_FLAGS}" )
	message( STATUS "CMAKE_SHARED_LINKER_FLAGS: ${CURRENT_SHARED_LINKER_FLAGS}" )
	set( CMAKE_CONFIGURATION_TYPES Release Profile Debug )
	set( CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Configurations" FORCE )
	
	# Release
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>: > )
	set( CMAKE_C_FLAGS_RELEASE "${CURRENT_C_FLAGS} -D_NDEBUG -DNDEBUG  -O3 -finline-functions " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_RELEASE "${CURRENT_CXX_FLAGS} -D_NDEBUG -DNDEBUG  -O3 -finline-functions " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_RELEASE  -DCOMPILER_CLANG "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_RELEASE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_RELEASE " -static" CACHE INTERNAL "" FORCE )
	# Profile
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Profile>: > )
	set( CMAKE_C_FLAGS_PROFILE "${CURRENT_C_FLAGS} -D_NDEBUG -DNDEBUG  -O2 " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_PROFILE "${CURRENT_CXX_FLAGS} -D_NDEBUG -DNDEBUG  -O2 " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_PROFILE "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_PROFILE  -DCOMPILER_CLANG "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_PROFILE  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_PROFILE " -static" CACHE INTERNAL "" FORCE )
	# Debug
	set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>: > )
	set( CMAKE_C_FLAGS_DEBUG "${CURRENT_C_FLAGS} -D_DEBUG -Og " CACHE STRING "" FORCE )
	set( CMAKE_CXX_FLAGS_DEBUG "${CURRENT_CXX_FLAGS} -D_DEBUG -Og " CACHE STRING "" FORCE )
	set( CMAKE_EXE_LINKER_FLAGS_DEBUG "${CURRENT_EXE_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CURRENT_STATIC_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CURRENT_SHARED_LINKER_FLAGS} " CACHE STRING "" FORCE )
	set( PROJECTS_SHARED_CXX_FLAGS_DEBUG  -DCOMPILER_CLANG "-D${TARGET_PLATFORM}" "-DPLATFORM_NAME=\"${CMAKE_SYSTEM_NAME}\"" "-DPLATFORM_CPU_NAME=\"${CMAKE_SYSTEM_PROCESSOR}\"" "-DPLATFORM_BITS=${PLATFORM_BITS}" CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_DEFINES_DEBUG  CACHE INTERNAL "" FORCE )
	set( PROJECTS_SHARED_LINKER_FLAGS_DEBUG " -static" CACHE INTERNAL "" FORCE )
	set( CMAKE_BUILD_TYPE "Debug")
endif()


if ( NOT DEFINED DETECTED_COMPILER )
	message( FATAL_ERROR "current compiler: '${CMAKE_CXX_COMPILER_ID}' is not configured for this project!" )
endif()

